load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")

package(default_visibility = ["//rs:system-tests-pkg"])

exports_files([
    "assets/vector.toml",
])

rust_library(
    name = "ic-system-test-driver",
    testonly = True,
    srcs = glob(["src/**/*.rs"]),
    aliases = {
        "//rs/utils": "utils",
    },
    compile_data = [
        ":assets/vector.toml",
    ],
    crate_name = "ic_system_test_driver",
    proc_macro_deps = [
        # Keep sorted.
        "@crate_index//:async-trait",
        "@crate_index//:strum_macros",
    ],
    target_compatible_with = ["@platforms//os:linux"],  # requires libssh that does not build on Mac OS
    visibility = [
        "//rs:system-tests-pkg",
    ],
    deps = [
        # Keep sorted.
        "//packages/icrc-ledger-types:icrc_ledger_types",
        "//rs/canister_client",
        "//rs/canister_client/sender",
        "//rs/config",
        "//rs/crypto/sha2",
        "//rs/crypto/tree_hash",
        "//rs/ic_os/config:config_lib_dev",
        "//rs/ic_os/config_types",
        "//rs/ic_os/deterministic_ips",
        "//rs/ic_os/dev_test_tools/setupos-image-config",
        "//rs/interfaces",
        "//rs/interfaces/registry",
        "//rs/ledger_suite/common/ledger_core",
        "//rs/ledger_suite/icp:icp_ledger",
        "//rs/ledger_suite/icrc1",
        "//rs/limits",
        "//rs/nervous_system/common",
        "//rs/nervous_system/common/test_keys",
        "//rs/nervous_system/proto",
        "//rs/nns/cmc",
        "//rs/nns/common",
        "//rs/nns/constants",
        "//rs/nns/governance/api",
        "//rs/nns/gtc",
        "//rs/nns/init",
        "//rs/nns/sns-wasm",
        "//rs/nns/test_utils",
        "//rs/phantom_newtype",
        "//rs/prep",
        "//rs/protobuf",
        "//rs/registry/canister",
        "//rs/registry/canister/api",
        "//rs/registry/helpers",
        "//rs/registry/keys",
        "//rs/registry/local_registry",
        "//rs/registry/nns_data_provider",
        "//rs/registry/provisional_whitelist",
        "//rs/registry/regedit",
        "//rs/registry/routing_table",
        "//rs/registry/subnet_features",
        "//rs/registry/subnet_type",
        "//rs/rosetta-api/icp:rosetta-api",
        "//rs/rust_canisters/canister_test",
        "//rs/rust_canisters/dfn_candid",
        "//rs/rust_canisters/dfn_protobuf",
        "//rs/rust_canisters/on_wire",
        "//rs/sns/governance",
        "//rs/sns/init",
        "//rs/sns/root",
        "//rs/sns/swap",
        "//rs/sys",
        "//rs/test_utilities/identity",
        "//rs/test_utilities/types",
        "//rs/tests/test_canisters/message:lib",
        "//rs/tests/test_canisters/signer:lib",
        "//rs/types/base_types",
        "//rs/types/management_canister_types",
        "//rs/types/types",
        "//rs/universal_canister/lib",
        "@crate_index//:anyhow",
        "@crate_index//:backon",
        "@crate_index//:base64",
        "@crate_index//:bincode",
        "@crate_index//:candid",
        "@crate_index//:chrono",
        "@crate_index//:clap",
        "@crate_index//:crossbeam-channel",
        "@crate_index//:ed25519-dalek",
        "@crate_index//:futures",
        "@crate_index//:hex",
        "@crate_index//:http",
        "@crate_index//:humantime",
        "@crate_index//:humantime-serde",
        "@crate_index//:ic-agent",
        "@crate_index//:ic-cdk",
        "@crate_index//:ic-utils",
        "@crate_index//:itertools",
        "@crate_index//:json5",
        "@crate_index//:lazy_static",
        "@crate_index//:macaddr",
        "@crate_index//:maplit",
        "@crate_index//:nix",
        "@crate_index//:num_cpus",
        "@crate_index//:once_cell",
        "@crate_index//:prost",
        "@crate_index//:rand",
        "@crate_index//:rand_chacha",
        "@crate_index//:regex",
        "@crate_index//:reqwest",
        "@crate_index//:ring",
        "@crate_index//:serde",
        "@crate_index//:serde_bytes",
        "@crate_index//:serde_cbor",
        "@crate_index//:serde_json",
        "@crate_index//:serde_regex",
        "@crate_index//:serde_yaml",
        "@crate_index//:slog",
        "@crate_index//:slog-async",
        "@crate_index//:slog-term",
        "@crate_index//:ssh2",
        "@crate_index//:strum",
        "@crate_index//:tempfile",
        "@crate_index//:thiserror",
        "@crate_index//:time",
        "@crate_index//:tokio",
        "@crate_index//:tokio-util",
        "@crate_index//:tracing",
        "@crate_index//:url",
        "@crate_index//:walkdir",
        "@crate_index//:wat",
        "@crate_index//:zstd",
    ],
)

rust_test(
    name = "generic_workload_engine",
    crate = ":ic-system-test-driver",
    deps = [
        "@crate_index//:assert_matches",
    ],
)
